<ix-modal-header
  [requiredRoles]="requiredRoles"
  [title]="'Access Settings' | translate"
  [loading]="isLoading()"
></ix-modal-header>
<mat-card>
  <mat-card-content>
    <form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
      <ix-fieldset>
        <ix-input
          formControlName="token_lifetime"
          type="number"
          [label]="'Session Timeout' | translate"
          [tooltip]="'Time in seconds after which current user session will be disconnected. Interacting with UI extends the session.' | translate"
        ></ix-input>
        @if (isEnterprise) {
          <ix-checkbox
            formControlName="ds_auth"
            [label]="'Allow Directory Service users to access WebUI' | translate"
          ></ix-checkbox>
        }
        <ix-textarea
          formControlName="login_banner"
          [label]="'Login Banner' | translate"
          [tooltip]="'When set, the following text will be shown prior to showing login page to the user' | translate"
        ></ix-textarea>
      </ix-fieldset>

      <ix-form-actions>
        <button
          *ixRequiresRoles="requiredRoles"
          mat-button
          type="submit"
          color="primary"
          ixTest="save"
          [disabled]="form.invalid || isLoading()"
        >
          {{ 'Save' | translate }}
        </button>
      </ix-form-actions>
    </form>
  </mat-card-content>
</mat-card>
